﻿using System;
using System.Collections.Generic;
using System.Text;
using Matrix.Common.Utility;
using Matrix.MaKaYunShang.BLL;
using Matrix.MaKaYunShang.Model;
using Microsoft.VisualStudio.TestTools.UnitTesting;

namespace Matrix.MaKaYunShang.WeChatTest
{
    [TestClass]
    public class UnitTest1
    {
        [TestMethod]
        public void TestMetHod()
        {
            var consumer = ConsumerBLL.Instance.GetConsumerInfoByMxWechatInfoUserId(1);

            var dd = ConsumerBLL.Instance.Update(consumer);
        }

        [TestMethod]
        public void TestMethod2()
        {
        }

        [TestMethod]
        public void TestMethod3()
        {
            //var strMatrixApiUrl = "http://localhost:8085/api/WechatInfo/AddWechatEventHistory?mcId={0}&random={1}&checkCode={2}";
            var strMatrixApiUrl = "http://cloudcenter.icloudmatrix.com/api/WechatInfo/GetMsgRobotWorkReply?replyType={0}&mcId={1}&random={2}&checkCode={3}";
            var strRandom = StringExtension.GenerateCheckCode(8);
            var strMyCode = 0 + "Y000002" + strRandom + "dda26a3d467c461a9d19b732e7f6da75";
            var strMyMd5Code = MD5Lib.Encrypt(strMyCode);
            strMatrixApiUrl = string.Format(strMatrixApiUrl, 0, "Y000002", strRandom, strMyMd5Code);

            var strJson = JsonTool.ObjToJson("8A41A174EFF4B43B0F9EEBA7EB175DCC1ED2BC378A14A61B3DC96703CD6ABE12F87A7E93EC003AF15AE0AC3147959B567F365F6935747588F05035BC0DE17DFE92BE916BD360867839188D03DA91EB1953AB18A6093D95443E748EF08EDB2CC1D603BDA1E5C8FDF8E8A4CED320C1D1ABD874E2F36932FAD9791107B494149384E57E077CF298668E14B9C7F94A5F6A1B754C13FE4F9F2527C877A618311CF8B738E5959A131FA571F1CEE77676FC5EC3D0B940227E57EBB3AD13947B85926CD11A30A53B4AA437FCD69B37B05565DA075DEB3F3A8AA59EF1A98CCAC58EE5234299A60D1A8C10B995B74D4A3F79E157720E1564F756290A1440876CDC010CBC99BC39502324D3C02DF85A0293A69B2220B977A7EEF9115E349898BEF5DDADDE85564767843E22CF8E2CB9B31FE34D1605A99231CF983C8D21BD9B62AC04686F1C86E0F38D453E6032B61001EE14617BA37C0CE1FF034C9025B0C12A4BD018C36F9BEC8F8B12B30570074DD7A6BFF21AC7E32B0F56AEE0672A4715BE592DB8647976C7358078D3F032C317AAE70EEC272EB702F4929E7A3BCB47C9D77F6823A388030FBB592D82D8A23925F306349C48488B0F7441059FE2F0BA79F4C37E31F1FDA1DE4CC9A5522F65EC9D52941CC3E7BA4F7D180F684A657D356EBB0EDCBD6BD8D65203A22F3E60CBC8F42133949F3E8694387F0C9926F1AFF6D19F8788267C759918720F2FC6172DB11406C8BE85B07BAA271822100EE1608CDE47A619D477AFABFE5AA75C8F1DE84508705F64279AAD2EFC4CA15010BA5BA03971CABF258AFEB30EBF959A64C738C829ED1B3E861E0A0E215FEBF35D6B8727A639042E638D7E1324255F541E5BB57B48BD59B743E27E85D212E18990BF0E4538EB76435F87480023AB7509A907D3864853F8CB6C762E696AAF9E7E6306ED24DFFCD53C02D55FEA07B3D8C8B512F7EE7B81D892198127C24FF96C9DDA9D32C15B9E5BC5F11CD234C03D8DB86CF850ED1E11768F434B517252AB177EE9011EF475C174F56BAF2FD9015D84A40E85F300F77F087139D70F3828282DD998EDD190814DC9DF1154EACF35A83F458ABC87164EEB2C7A6994C78E37E697CC47ECDA566D5B13DA56AB5E33AA6F9C5A020EAE65953E1E914DE3AB68A7AC17A3DECBADE50D9AA9C25D3F612377C068F68F8BD5F5C9AB94BC684CB9454EFDCB43EDC630F34EE4D674BFE32696CF6C40DB9CA85E9B74EAC162EEF8F9EBEF386B389F6FCC009956D6B8B31B236BDDF3924A7F1E4C69E2254D103A5B9EB7E57C3466DC5B5969E2254D103A5B9E0F1CD83712891853C721CB28EC08E4B2FDF50B7D7CAF68CFBD05D63CB555934A83B10C66618403C86D3F05D73448D1158603E4CB958C9CF1AA724C24A9B6444E7DAD65A988E07F17D442E9388FAA5B9783BC934CDE3C85A75226C3C6FB973FE5");
            var strResultJson = HttpClientHelper.PostResponse(strMatrixApiUrl, strJson);
            var ret = strResultJson;
        }
    }
}
